package com.coffeeloversupportlibrary.core.data;

import android.content.Context;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.room.RoomDatabase;

/**
 * @author puyv
 * @createTime 2021/11/3 15:37
 * @projectName CoffeeLoverSupportLibrary
 * @className IDiariesRepository.java
 * @description 数据仓库的顶级接口，实现多个数据源的统一管理
 */
public interface IDataRepository {
    /**
    * @date 2021/11/3 20:51
    * @params [service]
    * @return T
    * @description 获取 APIService 接口动态代理
    */
    <T> T getRetrofitService(@NonNull Class<T> service);


    /**
    * @date 2021/11/3 20:52
    * @params [database, dbName,context]
    * @return T
    * @description 给定参数，创建指定名称的数据库
    */
    <T extends RoomDatabase> T getRoomDatabase(@NonNull Class<T> database, @Nullable String dbName,@Nullable Context context);

}
